/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React, { useContext } from 'react';

export type OperateFun<T> = (key: string, i: T) => Promise<any>;

const TableOperateContext = React.createContext({} as any);

export function useTableOperateContext<T>() {
  const value = useContext<{ onOperate: OperateFun<T> }>(TableOperateContext);
  return value;
}

export default TableOperateContext;
